package com.xianglong.controller;

import com.xianglong.entity.testEntity;
import com.xianglong.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
@RequestMapping("/testXiangLong")
public class TestController {
    @Autowired
    private TestService testService;

    @ResponseBody
    @RequestMapping("/list")
    public List<testEntity> list(){
        return testService.list();
    }

    @ResponseBody
    @RequestMapping("/add")
    public int add(@RequestBody testEntity add){
        return testService.add(add);
    }

    @ResponseBody
    @RequestMapping("/upd")
    public int upd(@RequestBody testEntity upd){
        return testService.update(upd);
    }

    @ResponseBody
    @RequestMapping("/del")
    public int del(@RequestBody testEntity upd){
        return testService.delect(upd);
    }

}
